﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DataCentral.Dataset;

namespace DataCentral.UserControls
{
    public partial class ManageExceptionControl : CommonCenterControl
    {
        public ManageExceptionControl()
        {
            InitializeComponent();
        }


        private void ManageExceptionControl_Load(object sender, EventArgs e)
        {
            daException.Fill(dsBET.Exception);
        }

        private void btnFixed_Click(object sender, EventArgs e)
        {
            if (viewException.GetDataRow(viewException.FocusedRowHandle) is DataCentralDataset.ExceptionRow)
            {
                ((DataCentralDataset.ExceptionRow)viewException.GetDataRow(viewException.FocusedRowHandle)).IsFixed = true;
                bsException.EndEdit();
                daException.Update(dsBET.Exception);
            }
        }

        private void btnNotfixed_Click(object sender, EventArgs e)
        {
            if (viewException.GetDataRow(viewException.FocusedRowHandle) is DataCentralDataset.ExceptionRow)
            {
                ((DataCentralDataset.ExceptionRow)viewException.GetDataRow(viewException.FocusedRowHandle)).IsFixed = false;
                bsException.EndEdit();
                daException.Update(dsBET.Exception);
            }
        }
    }
}
